home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 4
/
Meeting Pearls Vol. IV (1996)(GTI - Schatztruhe)[!].iso
/
Pearls
/
dev
/
Monitor
/
Snoopy
/
Support
/
devlist.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-12-18
|
1KB
|
50 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <proto/exec.h>
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <exec/execbase.h>
#include <exec/devices.h>
char *ver="\0$VER: devlist Snoopy Support Tool 1.1 (01.01.94)";
extern struct ExecBase *SysBase;
struct di
{
struct di *next;
char *message;
};
struct di *anchor = NULL;
void AddDevInfo( struct Device *d )
{
struct di *n;
if( ( n = (struct di *)calloc( 1, sizeof( struct di ) ) ) != NULL )
{
n->next = anchor;
anchor = n;
n->message = strdup( d->dd_Library.lib_Node.ln_Name );
}
}
void main( void )
{
struct Node *np;
struct di *ptr;
Forbid();
for( np = SysBase->DeviceList.lh_Head;
np != (struct Node *)&(SysBase->DeviceList.lh_Tail);
np = np->ln_Succ )
{
AddDevInfo( (struct Device *)np );
}
Permit();
for( ptr=anchor; ptr != NULL; ptr = ptr->next )
printf( "DEVICE \"%s\"\n", ptr->message );
}